package P065_BasicTypeArrayConversion;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;

/**
 * 基本类型数组转换列表陷阱
 *
 */
public class BasicTypeArrayConversion {

    @Test
    public void Test1() {
        int[] data = {10000, 2, 3, 4, 5};
        List<int[]> list = Arrays.asList(data);
        System.out.println("list长度为:" + list.size());
        System.out.println("元素类型:" + list.get(0).getClass());
        System.out.println("前后是否相等:" + data.equals(list.get(0)));
    }
    @Test
    public void Test2() {
        Integer[] data = {1, 2, 3, 4, 5};
        List<Integer> list = Arrays.asList(data);
        System.out.println("list长度为:" + list.size());
        System.out.println("元素类型:" + list.get(0).getClass());
        System.out.println("前后是否相等:" + data.equals(list.get(0)));
    }
}
